package aufgabe2.worker;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.ArrayList;

/*
 * Class which send the results
 * -> the prime factor which was found
 */

public class ResultMessage implements Serializable {
	
	private static final long serialVersionUID = -6065578273626197783L;
	private ArrayList<BigInteger> aPrimeFactor; 
	private long cpuTime;
	private long sumRhoCycle;
	private BigInteger toFactorize;
	private boolean ended;
	private int calculId;
	
	public ResultMessage(BigInteger fact, ArrayList<BigInteger> prFact, long cpuTime, long sumRhoCycle){
		this.aPrimeFactor = prFact;
		this.cpuTime = cpuTime;
		this.sumRhoCycle = sumRhoCycle;
		this.toFactorize = fact;
	}
	
	public ResultMessage(){}
		

	/**
	 * @return the primeFactor
	 */
	public ArrayList<BigInteger> getPrimeFactor() {
		return aPrimeFactor;
	}

	/**
	 * @param primeFactor the primeFactor to set
	 */
	public void setPrimeFactor(ArrayList<BigInteger> rlist) {
		this.aPrimeFactor = rlist;
	}

	/**
	 * @return the cpuTime
	 */
	public long getCpuTime() {
		return cpuTime;
	}

	/**
	 * @param cpuTime the cpuTime to set
	 */
	public void setCpuTime(long cpuTime) {
		this.cpuTime = cpuTime;
	}

	/**
	 * @return the sumRhoCycle
	 */
	public long getSumRhoCycle() {
		return sumRhoCycle;
	}

	/**
	 * @param sumRhoCycle the sumRhoCycle to set
	 */
	public void setSumRhoCycle(long sumRhoCycle) {
		this.sumRhoCycle = sumRhoCycle;
	}

	public BigInteger getToFactorize() {
		return toFactorize;
	}

	public void setToFactorize(BigInteger toFactorize) {
		this.toFactorize = toFactorize;
	}

	public ArrayList<BigInteger> getListPrimeFactorsResult() {
		// TODO Auto-generated method stub
		return aPrimeFactor;
	}

	/**
	 * @return the ended
	 */
	public boolean isEnded() {
		return ended;
	}

	/**
	 * @param ended the ended to set
	 */
	public void setEnded(boolean ended) {
		this.ended = ended;
	}

	/**
	 * @return the calculId
	 */
	public int getCalculId() {
		return calculId;
	}

	/**
	 * @param calculId the calculId to set
	 */
	public void setCalculId(int calculId) {
		this.calculId = calculId;
	}
}